package com.yueqian.dao;

import com.yueqian.domain.Account;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccountDao {

    @Select("select * from account")
    List<Account> findAll() throws Exception;
    @Insert("insert into account(name,money) values(#{name},#{money})")
    void saveAccount(Account account)throws Exception;
    @Select("select * from account where id=#{id}")
    Account findById(Integer id)throws Exception;

    @Update("update account set money=#{money} where id=#{id}")
    void updateAccount(Account account1)throws Exception;
}
